<template>
    <div style="background-color: darkgray;">
        我是男孩
        <h3>1.子传父练习</h3>
        <button @click="$emit('handleBoy',{data:99})">向老爸汇报成绩</button>
        <h3>2.数据状态管理练习</h3>
        <button @click="store.increment(2000)">我赚了点奖学金，给老爸金库存一点</button>
        <button @click="store.decrement(1000)">我要交学费，从老爸金库拿一点</button>
        <h3>3.父传子练习</h3>
        老爸给我的奖励{{ moneyBoy }}
    </div>
</template>
<script setup>
import useCounterStore from '../stores/counter'
const store = useCounterStore()
defineProps(['moneyBoy'])
</script>